<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <title>行政申请在线申请-3</title>
    <link rel="stylesheet" href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" />
    <link rel="stylesheet" href="../static/layer/mobile/need/layer.css" th:href="@{/layer/mobile/need/layer.css}" />
    <link rel="stylesheet" href="../static/css/main.css" th:href="@{/css/main.css}" />
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

    <style>

    </style>
</head>

<body>
<div class="header">
    <div class="container">
    </div>
</div>

<div class="searchBar">
    <div class="container">
        <a class="toIndex" ><span><</span>返回首页</a>
    </div>
</div>

<section>
    <div class="container">
        <div class="info">
            <p>
                <i class="left_line"></i>
                <span>代理人信息</span>
            </p>
            <p>
                提示：代理人信息，便于调解组织与您联系
            </p>
        </div>

        <div class="row">
            <div class="col-sm-10" >
                 <form class="form-horizontal" action="apply_step4" method="post" >
                <div class="form-group">
                    <div class="radioGroup">
                        <label class="col-sm-3 control-label">代理人类型</label>
                        <div class="col-sm-9 radioBox">
                            <input type="radio"  name="agentType" value="0"  id='personal' checked="checked"  />
                            <label class="checkbox-inline" for='personal'>个人公民</label>
                            <input type="radio"  name="agentType" value="1" id='units'/>
                            <label class="checkbox-inline" for='units'>法人或组织</label>
                            <input type="radio"  name="agentType" value="2" id='noChoose'/>
                            <label class="checkbox-inline" for='noChoose'>无</label>

                        </div>
                    </div>
                </div>

                <div class="personalUnit">
                    <div class="form-group" style="margin-bottom:5px;">
                        <div class="col-sm-6" >
                            <label for="agentName" class="col-sm-3 control-label">姓名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="agentName"  id="agentName" placeholder="请填写姓名"/>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <label for="agentNation" class="col-sm-3 control-label">民族</label>
                            <div class="col-sm-9">
                                <select  class="form-control"  name="agentNation" id="agentNation" ></select>
                                <option value="" ></option>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentSex" class="col-sm-3 control-label">性别</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="agentSex" id="agentSex">
                                    <option value="" ></option>
                                    <option value="0">男</option>
                                    <option value="1">女</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <label for="agentVocation" class="col-sm-3 control-label">职业</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="agentVocation" name="agentVocation" placeholder="请填写职业"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentBirthday" class="col-sm-3 control-label">出生日期</label>
                            <div class="col-sm-9">
                                <div class='input-group date' id='datetimepicker1'>
                                    <input type='text' class="form-control" name="agentBirthday" id="agentBirthday" />
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span>
                                    </span>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <label for="agentPostalCode" class="col-sm-3 control-label">邮政编码</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="agentPostalCode" name="agentPostalCode" placeholder="请填写邮政编码"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentLocation" class="col-sm-3 control-label">所在地</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  name="agentLocation" id="agentLocation" placeholder="请填写地址"/>
                            </div>
                        </div>

                        <div class="col-sm-6" >
                            <label for="agentPhone" class="col-sm-3 control-label">手机号码</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  onblur="isPhone(this.value);"  name="agentPhone" id="agentPhone"  placeholder="请填写联系电话" />
                            </div>
                        </div>
                    </div>
                    <div class="form-group">

                        <div class="col-sm-6">
                            <label for="agentFixedphone" class="col-sm-3 control-label">固定电话</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="agentFixedphone" id="agentFixedphone" placeholder="请填写固定电话" />
                            </div>
                        </div>

                        <div class="col-sm-6" >
                            <label for="agentAddress" class="col-sm-3 control-label">住址</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  name="agentAddress" id="agentAddress" placeholder="请填写地址"/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="governmentUnit">
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentCompanyName" class="col-sm-3 control-label">机构名称</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="agentCompanyName" name="agentCompanyName" placeholder="请填写机构名称"/>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <label for="agentCompanyNum" class="col-sm-3 control-label">组织机构代码</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="agentCompanyNum" name="agentCompanyNum" placeholder="请填写组织机构代码"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentLegalPerson" class="col-sm-3 control-label">法人代表</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  name="agentLegalPerson" id="agentLegalPerson" placeholder="请填写法人代表"/>
                            </div>
                        </div>

                        <div class="col-sm-6" >
                            <label for="agentContacts" class="col-sm-3 control-label">联系人姓名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  name="agentContacts" id="agentContacts" placeholder="请填写联系人姓名"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6" >
                            <label for="agentContactsPhone" class="col-sm-3 control-label">联系电话</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  name="agentContactsPhone" id="agentContactsPhone" placeholder="请填写联系电话"/>
                            </div>
                        </div>

                        <div class="col-sm-6" >
                            <label for="agentContactsEmail" class="col-sm-3 control-label">电子邮箱</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control"  onblur="isEmail(this.value);"   name="agentContactsEmail" id="agentContactsEmail" placeholder="请填写电子邮箱"/>
                            </div>
                        </div>
                    </div>

                </div>



            </form>

                <div class="form-group">
                    <div class="footer">
                        <button class="btn-primary" onclick="back()">上一步 </button>
                        <button class="btn-primary nextStep">下一步 </button>
                    </div>
                </div>
            </div>

            <div class="col-sm-2" >
                <div class="imgBox">
                    <img src="../static/image/law_steps_img_3@2x.png"  th:src="@{image/law_steps_img_3@2x.png}" alt=""/>
                </div>
            </div>
        </div>
    </div>
</section>

<script src="../static/js/jquery-3.4.1.min.js" th:src="@{js/jquery-3.4.1.min.js}"></script>
<script src="../static/js/common.js"  th:src="@{js/common.js}"></script>
<script src="../static/js/bootstrap.min.js"  th:src="@{js/bootstrap.min.js}"></script>
<script src="../static/layer/layer.js"  th:src="@{layer/layer.js}"></script>
<script src="../static/js/moment-with-locales.min.js"  th:src="@{js/moment-with-locales.min.js}"></script>
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">


    $('.toIndex').click(function(){
        window.location.href="/index";
    })

$(function () {
    $('#datetimepicker1').datetimepicker({
        format: 'YYYY-MM-DD',
        locale: moment.locale('zh-cn')
    });
 });

<!--民族插件-->
var nations = ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族",
"土家族", "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族", "土族",
"达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族", "俄罗斯族", "鄂温克族",
"德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"];
var option = "";
for(var i = 0; i <
	nations.length; i++) {
	option += '<option value="' +  nations[i] + '">' + nations[i] + '</option>';
}
	$(option).appendTo("#agentNation");



    $(document).ready(function(){
         $(".personalUnit").show();
         $(".governmentUnit").hide();
         $("input:radio[name='unit']").eq(0).attr("checked",true);
     });

	$(":radio").change(function () {
		if ($(this).val() == "0") {
		    $(".personalUnit").show();
		    $(".governmentUnit").hide();
		} else if($(this).val() == "1"){
		  $(".personalUnit").hide();
		  $(".governmentUnit").show();
		}else{
          $(".personalUnit").hide();
		  $(".governmentUnit").hide();
		}
	})


    $('.nextStep').click(function() {
	var agentType=$('input:radio[name="agentType"]:checked').val();
	<!--个人-->
	if(agentType==0){

       if($('#agentName').val()==''){
            layer.msg('请填写姓名');
           return false;
       }
        if($('#agentNation').val()==''){
            layer.msg('请选择民族');
         return false;
       }
       if($('#agentSex').val()==''){
            layer.msg('请选择性别');
           return false;
       }
        if($('#agentVocation').val()==''){
            layer.msg('请填写职业');
           return false;
       }
       if($('#agentBirthday').val()==''){
            layer.msg('请选择出生年月');
            return false;
       }
       if($('#agentPostalCode').val()==''){
            layer.msg('请填写邮政编码');
       }
       if($('#agentLocation').val()==''){
            layer.msg('请填写所在地');
       }
       if($('#agentPhone').val()==''){
            layer.msg('请填写手机号码');
       }
         if($('#agentFixedphone').val()==''){
            layer.msg('请填写固定电话');
           return false;
       }
       if($('#agentAddress').val()==''){
            layer.msg('请填写住址');
              return false;
       }

	}else if(agentType==1){
        if($('#agentCompanyName').val()==''){
            layer.msg('请填写机构名称');
             return false;;
       }

        if($('#agentCompanyNum').val()==''){
            layer.msg('请填写组织机构代码');
            return false;
       }

        if($('#agentLegalPerson').val()==''){
            layer.msg('请填写法人代表');
              return false;
       }

        if($('#agentContacts').val()==''){
            layer.msg('请填写联系人姓名');
              return false;
       }

         if($('#agentContactsPhone').val()==''){
            layer.msg('请填写联系电话');
              return false;
       }
         if($('#agentContactsEmail').val()==''){
            layer.msg('请填写电子邮箱');
              return false;
       }
	}else{

	}
   $("form").submit();
 })


</script>
</body>

</html>
